//
//  CategorySelectView.m
//  quanminzhekou
//
//  Created by zxl on 15/1/12.
//  Copyright (c) 2015年 zhongqinglongtu. All rights reserved.
//

#import "CategorySelectView.h"

@implementation CategorySelectView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake((CGRectGetWidth(frame) - 168) / 2.0, 0, 168, 0) style:UITableViewStylePlain];
        [_tableView registerClass:[CategorySelectCell class] forCellReuseIdentifier:@"CategorySelectCell"];
        _tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.rowHeight = 48;
        _tableView.showsVerticalScrollIndicator = NO;
        [self addSubview:_tableView];
    }
    
    return self;
}

- (void)setFrame:(CGRect)frame {
    [super setFrame:frame];
    CGRect tableViewFrame = self.tableView.frame;
    tableViewFrame.size.height = CGRectGetHeight(frame);
    self.tableView.frame = tableViewFrame;
}

@end
